<!-- 该页面是从专科的页面跳转过来的医生列表页面 -->
<template>
	<view>
		<view class="doctor-outbox" @click="toDoctorBrief(item)" v-for="item in list" :key="item.id">
			<image class="doctor-icon" src="/static/appointment/man-doctor.png"></image>
			<view class="doctor-info">
				<text class="doctor-name text-position">{{item.name}}</text>
				<text class="gray-text text-position">{{item.jobTitle}}</text>
			</view>
		</view>
	<!-- 	<view class="doctor-outbox" @click="toDoctorBrief()">
			<image class="doctor-icon" src="/static/appointment/women-doctor.png"></image>
			<view class="doctor-info">
				<text class="doctor-name text-position">杨XX</text>
				<text class="gray-text text-position">医师</text>
			</view>
		</view> -->
	</view>
</template>

<script>
	import { getDoctorLists } from '../../../../common/api/req.js'
	export default {
		data() {
			return {
				outpatientId: '',
				specialId:'',
				list:[], //医生列表 
			}
		},
		onLoad(option) {
			this.$data.outpatientId = option.id
			this.$data.specialId = option.specialId
			// console.log("医生列表页面",this.$data.outpatientId)
			// console.log("医生列表页面",this.$data.specialId)
			this.getDoctorList()
			// console.log(this.$data.list)
		},
		created() {
			
		},
		methods: {
			toDoctorBrief:function(item) {
				
			let doctor = JSON.stringify(item);
			
				uni.navigateTo({
					//需要携带 医生信息 带下一个页面
					url: '/pagesB/pages/appointPages/doctorAppointDetail/doctorAppointDetail?isTreatmentTime=' + 2+'&doctor='+doctor,
					//医生对象
					
				})
			},
			//获取医生列表
			getDoctorList(){
				const _this = this
				getDoctorLists(this.$data.specialId,this.$data.outpatientId,1,10,"").then( res =>{
					_this.list = res.data.data.list
					console.log(_this.list)
				})
			}
		}
	}
</script>

<style lang="scss">
	@import '@/common/scss/common.scss';
	@import '@/common/scss/doctor.scss';
	.text-position{
		width: 60%;
		height: 50%;
		display: flex;
		align-items: center;
	}
	.gray-text{
		@include font-style(16px, 500, $gray-color);
	}
	.doctor-name{
		@include font-style(16px, bold, #000000);
	}
</style>
